package tk.hongbo.paging3

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import androidx.paging.PagingData
import androidx.paging.cachedIn
import kotlinx.coroutines.flow.Flow
import tk.hongbo.paging3.module.data.Repository
import tk.hongbo.paging3.module.pojo.Repo


/**
 * Created by HongboZhao on 2021/12/1.
 */
class MainViewModel : ViewModel() {
    fun getPagingData(): Flow<PagingData<Repo>> {
        return Repository.getPagingData().cachedIn(viewModelScope)
    }
}